#include<iostream>
#include"ThreadPool.hpp"
#include"Task.hpp"
#include<ctime>
 int main()
 {
    srand(time(nullptr)); 
   ThreadPool<Task> * tp = new ThreadPool<Task>  (5) ;
    tp->Start() ;
    while(1)
    {
        //创建任务
        int x = rand() %10 + 1 ;
        usleep(10) ;
        int y = rand() %5  ;
        Task t (x, y ,opers[rand()%opers.size()] ) ;
        //线程池处理任务 
        tp->Push(t) ;
          std::cout<<"main thread is running "<<std::endl;
          sleep(1) ;
    }
    return 0 ;
 }